<?php
/**
 * @copyright:Copyright (C) 2010-2014 LiZaoNet Inc. (http://www.lizaonet.com)
 * @license: http://www.lizaonet.com
 * @link:http://www.lizaonet.com
 * @since:File available since Release v1.0
 * @Created by Azrael
 * @User: Azrael
 * @Date: 2016/1/26
 * @Time: 16:54
 *
 */

namespace Home\Model;


use Think\Model;

class LiaotianModel extends Model
{
    protected $tableName = "liaotianlist";
    /**
     * 获取聊天
     * @param $now
     * @param $fid
     * @return mixed
     */
    public function getLiaotian($now, $fid,$type)
    {

        $list = $this->field("a.*,b.adminid,b.nickname")->alias("a")->join(array(" __USERLIST__ b on a.mid=b.mid"),"left")->where(array("a.shstatus"=>1,"a.msgtype"=>$type,"a.siliao"=>0,"a.shtime"=>array("lt",$now),"a.fid"=>$fid))->order("a.shtime desc")->limit(20)->select();

        return $list;
    }


}